package com.company.hrmadmin.modules.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.company.hrmadmin.modules.domain.LoginToken;
import com.company.hrmadmin.modules.mapper.LoginTokenMapper;
import com.company.hrmadmin.modules.service.LoginTokenService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author Xmirror
 * @description 针对表【sys_login_token(登录凭证)】的数据库操作Service实现
 * @createDate 2022-04-01 14:11:09
 */
@Service
public class LoginTokenServiceImpl extends ServiceImpl<LoginTokenMapper, LoginToken>
        implements LoginTokenService {

    @Resource
    private LoginTokenMapper loginTokenMapper;

    @Override
    public LoginToken getLoginToken(String token) {
        return loginTokenMapper.selectOne(Wrappers.lambdaQuery(LoginToken.class)
                .eq(LoginToken::getToken, token));
    }
}




